//
//  HLEditSignatureCell.m
//  YueYue
//
//  Created by hulu001 on 2023/5/19.
//

#import "HLEditSignatureCell.h"

@interface HLEditSignatureCell ()

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) QMUITextView *textView;

@end

@implementation HLEditSignatureCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = UIColorClear;
        self.contentView.backgroundColor = UIColorWhite;
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    self.titleLabel = [[UILabel alloc] init];
    _titleLabel.font = UIFontMediumMake(13);
    _titleLabel.textColor = HLTextColor3;
    _titleLabel.text = @"个性签名";
    [self.contentView addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(12);
        make.top.mas_equalTo(20);
    }];
    
    self.textView = [[QMUITextView alloc] init];
    _textView.placeholder = @"写点什么让别人更了解你…";
    _textView.font = UIFontMake(14);
    _textView.textColor = HLTextColor1;
    _textView.contentInset = UIEdgeInsetsMake(12, 12, 12, 12);
    _textView.backgroundColor = HLBackgroundColor;
    _textView.layer.masksToBounds = YES;
    _textView.layer.cornerRadius = 4;
    _textView.editable = NO;
    _textView.maximumTextLength = 150;
    _textView.userInteractionEnabled = NO;
    [self.contentView addSubview:_textView];
    [_textView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(12);
        make.top.equalTo(_titleLabel.mas_bottom).offset(8);
        make.right.mas_equalTo(-12);
        make.bottom.mas_equalTo(-20);
        make.height.mas_equalTo(64);
    }];
}

- (void)setModel:(HLUserInfoModel *)model
{
    _model = model;
    _textView.text = model.selfSign;
}
@end
